﻿<Window x:Class="DTC.Popups.MedicalRecordPopup"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:Converters="clr-namespace:DTC.Converters"
        xmlns:Res="clr-namespace:DTC.Resources"
        xmlns:Validations="clr-namespace:DTC.Validations"
        Title="Медецинская карта" Height="800" Width="670" Style="{StaticResource PopupWindow}"
        Closing="Window_Closing"
        Loaded="Window_Loaded">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="../Resources/Brushes.xaml"/>
                <ResourceDictionary Source="../Resources/ButtonsStyles.xaml"/>
                <ResourceDictionary Source="../Resources/ComboBoxesStyles.xaml"/>
                <ResourceDictionary Source="../Resources/TextEditStyles.xaml"/>
                <ResourceDictionary Source="../Resources/ListBoxStyles.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>
	<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
	<Grid Name="MainGrid" Margin="20,10,10,20" VerticalAlignment="Top" Background="{x:Null}">
        <StackPanel VerticalAlignment="Top" HorizontalAlignment="Stretch">
            <WrapPanel Width="Auto" HorizontalAlignment="Center" Margin="0,10,0,0">
                <TextBlock HorizontalAlignment="Center" 
                           VerticalAlignment="Center"
                           Foreground="{DynamicResource MarkingFontColor}" 
                           FontSize="17"
                           Text="Медицинская карта пациента №:"/>
                    <TextBox Margin="10,0,0,0" 
                         x:Name="PatientNumberTB"
                         Width="150"
                         FontSize="16"
                         Height="24"
                         VerticalAlignment="Center"
                         TextAlignment="Center">
                        <TextBox.Text>
                            <Binding Path="PatientNumber">
                                <Binding.ValidationRules>
                                    <Validations:EmptyValidate/>
                                </Binding.ValidationRules>
                            </Binding>
                        </TextBox.Text>
                    </TextBox>                         
            </WrapPanel>
			 <StackPanel HorizontalAlignment="Right" Margin="0,35,5,0">
                <WrapPanel>
                    <TextBlock Foreground="{StaticResource MarkingFontColor}"
                               VerticalAlignment="Top"
                               Margin="0,3,0,0"
                               Text="Лечащий врач: "
                               FontSize="12"/>
                        <AdornerDecorator>
                            <ComboBox x:Name="DoctorComboBox"
                              Width="200"
                              Margin="5,2,0,0"
                              IsEditable="True"
                              DisplayMemberPath="FullName">
                                <Res:WatermarkService.Watermark>
                                    <TextBlock Text="Фамилия Имя Отчество"
                                               FontSize="11"
                                               FontFamily="Arial"
                                               FontStyle="Italic"
                                               Foreground="Black"/>
                                </Res:WatermarkService.Watermark>
                            </ComboBox>
                        </AdornerDecorator>
                    </WrapPanel>
                <WrapPanel Margin="0,3,0,0">
                    <TextBlock Foreground="{StaticResource MarkingFontColor}"
                               Text="Дата постановки на учет: "
                               FontSize="12"/>
                    <TextBox Margin="5,0,0,0"
                             Width="90"
                             x:Name="RegistrationDateTB"
                             TextAlignment="Center">
                        <Binding Path="RegistrationDate"
                                 NotifyOnValidationError="True">
                                <Binding.ValidationRules>
                                    <Validations:DateValidation/>
                                </Binding.ValidationRules>
                                <Binding.Converter>
                                <Converters:DateTimeToDateConverter/>
                            </Binding.Converter>
                        </Binding>
                        </TextBox>
                </WrapPanel>
            </StackPanel>
			<Border BorderBrush="{StaticResource GrouperBorderBrush}" BorderThickness="1"
					CornerRadius="3" 
                       Margin="0,25,0,0"
					   Padding="20">
					<StackPanel>
            <WrapPanel Width="Auto">
                <TextBlock Foreground="{StaticResource MarkingFontColor}" 
                           VerticalAlignment="Center"
                           Text="Фамилия:"
                           FontSize="12"/>
                <TextBox Margin="6,0,0,0"
						 Width="190">
                    <TextBox.Text>
                        <Binding Path="Surname"
                                 NotifyOnValidationError="True">
                            <Binding.ValidationRules>
                                <Validations:EmptyValidate/>
                            </Binding.ValidationRules>
                        </Binding>
                    </TextBox.Text>
                </TextBox>

                <TextBlock Foreground="{StaticResource MarkingFontColor}" 
                           VerticalAlignment="Center"
                           Text="Имя:"
                           Margin="20,0,0,0"/>
                <TextBox Margin="6,0,0,0"
                         Width="190">
                    <TextBox.Text>
                        <Binding Path="Name"
                                 NotifyOnValidationError="True">
                            <Binding.ValidationRules>
                                <Validations:EmptyValidate/>
                            </Binding.ValidationRules>
                        </Binding>
                    </TextBox.Text>
                </TextBox>
            </WrapPanel>
            <WrapPanel Width="Auto" HorizontalAlignment="Left"
                       Margin="0,25,0,0">
                <TextBlock Foreground="{StaticResource MarkingFontColor}" 
                           VerticalAlignment="Center"
                           Text="Отчество:"
                           FontSize="12"/>
                <TextBox Text="{Binding Path=Fathername}"
                         Margin="6,0,0,0"
                         Width="160"/>
				<TextBlock Foreground="{StaticResource MarkingFontColor}" 
                           VerticalAlignment="Center"
						   Margin="25,0,0,0"
                           Text="Дата рождения:"
                           FontSize="12"/>
                            <AdornerDecorator>
                                <TextBox Margin="6,0,0,0"
                         x:Name="BirthDateTB"
                         Width="90"
                         TextAlignment="Center">
                                    <Binding Path="DateOfBirth">
                                        <Binding.ValidationRules>
                                            <Validations:DateValidation/>
                                        </Binding.ValidationRules>
                                        <Binding.Converter>
                                            <Converters:DateTimeToDateConverter/>
                                        </Binding.Converter>
                                    </Binding>
                                    <Res:WatermarkService.Watermark>
                                        <TextBlock Text="дд.мм.гггг"
                                                   FontSize="11"
                                                   FontFamily="Arial"
                                                   FontStyle="Italic"
                                                   Foreground="Black"
                                                   HorizontalAlignment="Center"
                                                   VerticalAlignment="Center"/>
                                    </Res:WatermarkService.Watermark>
                                </TextBox>
                            </AdornerDecorator>

                            <TextBlock Foreground="{StaticResource MarkingFontColor}"
                           Text="Пол:"
                           Margin="20,0,0,0"
                           VerticalAlignment="Center"/>
                <CheckBox x:Name="SexToB" 
                          Margin="5,0,0,0" Height="19" Width="23"
                          Style="{StaticResource SexButton}" 
                          IsChecked="{Binding Path=Sex}"
                          VerticalAlignment="Center"/>
            </WrapPanel>
            <WrapPanel HorizontalAlignment="Left" Margin="0,25,0,0">
                <TextBlock Foreground="{StaticResource MarkingFontColor}"
                           Text="Код заболевания:"
                           VerticalAlignment="Top"
                           Margin="0,3,0,0"
                           FontSize="12"/>
                            <AdornerDecorator>
                                <ComboBox x:Name="DeseaseCodeComboBox" 
                                          DisplayMemberPath="FullName"
                                          Height="23" Width="240" 
                                          Margin="5,0,0,0" IsEditable="True" 
                                          VerticalContentAlignment="Center">
                                    <Res:WatermarkService.Watermark>
                                        <TextBlock Text="Код - Название"
                                                   FontSize="11"
                                                   Margin="0,3,0,0"
                                                   FontFamily="Arial"
                                                   FontStyle="Italic"
                                                   Foreground="Black"/>
                                    </Res:WatermarkService.Watermark>
                                </ComboBox>
                            </AdornerDecorator>
                        </WrapPanel>
			<WrapPanel HorizontalAlignment="Left" Margin="0,5,0,0">
				<TextBlock Foreground="{StaticResource MarkingFontColor}"
                           Text="Диагноз:"
                           VerticalAlignment="Top"
                           Margin="0,3,0,0"/>
				<TextBox Height="60" Width="280"
                            Text="{Binding Diagnosis}"
							TextWrapping="Wrap"
							AcceptsReturn="True"
							AutoWordSelection="True"
							VerticalContentAlignment="Top"
							Margin="10,0,0,0"
							BorderThickness="1"
							BorderBrush="Gray"
							VerticalScrollBarVisibility="Auto"/>
			</WrapPanel>
			</StackPanel>
			</Border>
			<Border BorderBrush="#FFC1C1C1"
					BorderThickness="1"
					CornerRadius="3"
                    Margin="0,40,0,0"
					Padding="20,10,20,10">
				<StackPanel>
            <WrapPanel Width="Auto" HorizontalAlignment="Left">
                <TextBlock Foreground="{StaticResource MarkingFontColor}" 
                           VerticalAlignment="Top"
                           Margin="0,3,0,0"
                           Text="Страховая Организация:"
                           FontSize="12"/>
                <ComboBox x:Name="InsuranceCompanyComboBox"
                          DisplayMemberPath="Name"
                          IsEditable="True"
                          Height="23"
                          Margin="6,0,0,0"
                          Width="326"/>
            </WrapPanel>
            <WrapPanel Width="Auto" HorizontalAlignment="Left"
                       Margin="0,10,0,0">
                <TextBlock Foreground="{StaticResource MarkingFontColor}" 
                           VerticalAlignment="Center"
                           Text="Номер Страхового полиса:"
                           FontSize="12"/>
                            <TextBox Margin="6,0,0,0"
                                     Width="200">
                                <TextBox.Text>
                                    <Binding Path="InsuranceNumber"
                                 NotifyOnValidationError="True">
                                        <Binding.ValidationRules>
                                            <Validations:EmptyValidate/>
                                        </Binding.ValidationRules>
                                    </Binding>
                                </TextBox.Text>
                            </TextBox>
                        </WrapPanel>
            <WrapPanel Width="Auto" HorizontalAlignment="Right"
                       Margin="0,3,20,0">
                <TextBlock Foreground="{StaticResource MarkingFontColor}" 
                           VerticalAlignment="Center"
                           Text="Код льготы:"
                           FontSize="12"/>
                <TextBox Text="{Binding Path=BenefitCode}"
                         Margin="6,0,0,0"
                         Width="70"/>
            </WrapPanel>
            <WrapPanel Width="Auto" HorizontalAlignment="Left"
                       Margin="0,-5,0,0">
                <TextBlock Foreground="{StaticResource MarkingFontColor}" 
                           VerticalAlignment="Center"
                           Text="СНИЛС:"/>
                <TextBox Text="{Binding Path=SNILS}"
                         Margin="10,0,0,0"
                         Width="250"/>
            </WrapPanel>
			<WrapPanel Margin="0,15,0,0">
				<TextBlock Text="Инвалидность: "/>
				<TextBox Text="{Binding Disability}"
							Width="400"
							Margin="10,0,0,0"/>
			</WrapPanel>
			<WrapPanel Margin="0,15,0,0">
				<TextBlock Text="ЛОТ: "/>
				<TextBox Name="LotTextBox"
                         Text="{Binding LOT}"
							Width="200"
							Margin="10,0,0,0"/>
			</WrapPanel>
			<WrapPanel Margin="0,15,0,0">
				<TextBlock Text="Поликлиника: "
							VerticalAlignment="Top"/>
				<ComboBox Name="PolyclinycComboBox"
                          Width="190"
                          DisplayMemberPath="Name"
                          IsEditable="True"
                          Margin="10,0,0,0"
                          VerticalAlignment="Top"
                          SelectionChanged="PolyclinycComboBox_SelectionChanged"/>
				<TextBlock Text="Тел. поликлиники:"
							Margin="15,0,0,0"
							VerticalAlignment="Top"/>
				<TextBox Name="PolyclinicPhoneTB"
                         Text="{Binding DTCPolyclinic.Phone}"
						Width="100"
						VerticalAlignment="Top"
						Margin="5,0,0,0"/>
					</WrapPanel>
				</StackPanel>
			</Border>
            <Expander Name="AddressExpander"
						Margin="0,20,0,0"
						IsExpanded="True">
						<Expander.Header>
						<TextBlock Text="Адрес:"
							FontSize="12"
							FontWeight="Bold"/>
					</Expander.Header>
				<Border BorderBrush="{StaticResource GrouperBorderBrush}"
						BorderThickness="1"
						CornerRadius="3"
						Padding="20">
					<StackPanel>
						<WrapPanel Width="Auto" HorizontalAlignment="Left">
                <TextBlock Foreground="{StaticResource MarkingFontColor}" 
                           VerticalAlignment="Top"
                           Margin="0,3,2,0"
                           Text="Oбласть: "
                           FontSize="12"/>
                <ComboBox x:Name="AddressRegionComboBox"
                          DisplayMemberPath="Name"
                          IsEditable="True"
                          Height="23"
                          Width="190"/>
				<TextBlock Foreground="{StaticResource MarkingFontColor}" 
                           VerticalAlignment="Top"
                           Margin="20,3,0,0"
                           Text="Район: "/>
                <ComboBox x:Name="AddressAreaComboBox"
                          DisplayMemberPath="Name"
                          IsEditable="True"
                          Height="23"
                          Margin="5,0,0,0"
                          Width="195"/>
            </WrapPanel>
            <WrapPanel Width="Auto" HorizontalAlignment="Left"
                       Margin="0,5,0,0">
                <TextBlock Foreground="{StaticResource MarkingFontColor}" 
                           VerticalAlignment="Top"
                           Text="Населенный пункт: "
                           Margin="0,3,0,0"/>
                <ComboBox x:Name="AddressCityComboBox"
                          DisplayMemberPath="Name"
                          Margin="3,0,0,0"
                          IsEditable="True"
                          Height="23"
                          Width="160"/>
				<TextBlock Foreground="{StaticResource MarkingFontColor}" 
                           VerticalAlignment="Top"
                           Margin="10,3,0,0"
                           Text="Округ: "/>
                <ComboBox x:Name="AddressDistrictComboBox"
                          DisplayMemberPath="Name"
                          Margin="3,0,0,0"
                          IsEditable="True"
                          Height="23"
                          Width="180"/>
            </WrapPanel>
			<WrapPanel Width="Auto" HorizontalAlignment="Left"
                       Margin="0,5,0,0">
			<TextBlock Foreground="{StaticResource MarkingFontColor}" 
                           VerticalAlignment="Top"
                           Margin="0,3,0,0"
                           Text="Улица: "/>
                <ComboBox x:Name="AddressStreetComboBox"
                          DisplayMemberPath="Name"
                          Margin="3,0,0,0"
                          IsEditable="True"
                          Height="23"
                          Width="250"/>
			</WrapPanel>
            <WrapPanel Width="Auto" HorizontalAlignment="Left"
                       Margin="0,10,0,0">
                <TextBlock Foreground="{StaticResource MarkingFontColor}" 
                           VerticalAlignment="Top"
                           Margin="0,3,0,0"
                           Text="Дом: "/>
                <TextBox x:Name="AddressBuildingTextBox"
                         VerticalAlignment="Top"
                         Margin="3,3,0,0"
                         Width="50"/>
                <TextBlock Foreground="{StaticResource MarkingFontColor}" 
                           VerticalAlignment="Top"
                           Margin="20,3,0,0"
                           Text="Корпус: "/>
                <TextBox x:Name="AddressCorpTextBox"
                         VerticalAlignment="Top"
                         Margin="3,3,0,0"
                         Width="50"/>
                <TextBlock Foreground="{StaticResource MarkingFontColor}" 
                           VerticalAlignment="Top"
                           Margin="20,3,0,0"
                           Text="Квартира: "/>
                <TextBox x:Name="AddressAptTextBox"
                         VerticalAlignment="Top"
                         Margin="5,3,0,0"
                         Width="50"/>
            </WrapPanel>
            <WrapPanel Width="Auto" HorizontalAlignment="Left"
                       Margin="0,20,0,0">
                <TextBlock Foreground="{StaticResource MarkingFontColor}" 
                           VerticalAlignment="Center"
                           Text="Домашний телефон: "/>
                <TextBox Width="150"
                         x:Name="AddressPhoneTextBox"/>
            </WrapPanel>
					</StackPanel>
				</Border>
			</Expander>

			<Expander Name="RegistrationExpander" 
					Margin="0,10,0,0"
					IsExpanded="True">
					<Expander.Header>
						<TextBlock Text="Адрес регистрации:"
							FontSize="12"
							FontWeight="Bold"/>
					</Expander.Header>
				<Border BorderBrush="{StaticResource GrouperBorderBrush}"
						BorderThickness="1"
						CornerRadius="3"
						Padding="20">
					<StackPanel>
						<WrapPanel Width="Auto" HorizontalAlignment="Left">
                <TextBlock Foreground="{StaticResource MarkingFontColor}" 
                           VerticalAlignment="Top"
                           Margin="0,3,2,0"
                           Text="Oбласть: "
                           FontSize="12"/>
                <ComboBox x:Name="RegistrationRegionComboBox"
                          DisplayMemberPath="Name"
                          IsEditable="True"
                          Height="23"
                          Width="190"/>
				<TextBlock Foreground="{StaticResource MarkingFontColor}" 
                           VerticalAlignment="Top"
                           Margin="20,3,0,0"
                           Text="Район: "/>
                <ComboBox x:Name="RegistrationAreaComboBox"
                          DisplayMemberPath="Name"
                          IsEditable="True"
                          Height="23"
                          Margin="5,0,0,0"
                          Width="195"/>
            </WrapPanel>
            <WrapPanel Width="Auto" HorizontalAlignment="Left"
                       Margin="0,5,0,0">
                <TextBlock Foreground="{StaticResource MarkingFontColor}" 
                           VerticalAlignment="Top"
                           Text="Населенный пункт: "
                           Margin="0,3,0,0"/>
                <ComboBox x:Name="RegistrationCityComboBox"
                          DisplayMemberPath="Name"
                          Margin="3,0,0,0"
                          IsEditable="True"
                          Height="23"
                          Width="160"/>
						  <TextBlock Foreground="{StaticResource MarkingFontColor}" 
                           VerticalAlignment="Top"
                           Margin="10,3,0,0"
                           Text="Округ: "/>
                <ComboBox x:Name="RegistrationDistrictComboBox"
                          DisplayMemberPath="Name"
                          Margin="3,0,0,0"
                          IsEditable="True"
                          Height="23"
                          Width="180"/>
			</WrapPanel>
			<WrapPanel Width="Auto" HorizontalAlignment="Left"
                       Margin="0,5,0,0">
				<TextBlock Foreground="{StaticResource MarkingFontColor}" 
                           VerticalAlignment="Top"
                           Margin="10,3,0,0"
                           Text="Улица: "/>
                <ComboBox x:Name="RegistrationStreetComboBox"
                          DisplayMemberPath="Name"
                          Margin="3,0,0,0"
                          IsEditable="True"
                          Height="23"
                          Width="250"/>
            </WrapPanel>
            <WrapPanel Width="Auto" HorizontalAlignment="Left"
                       Margin="0,10,0,0">
                <TextBlock Foreground="{StaticResource MarkingFontColor}" 
                           VerticalAlignment="Top"
                           Margin="0,3,0,0"
                           Text="Дом: "/>
                <TextBox x:Name="RegistrationBuildingTextBox"
                         VerticalAlignment="Top"
                         Margin="3,3,0,0"
                         Width="50"/>
                <TextBlock Foreground="{StaticResource MarkingFontColor}" 
                           VerticalAlignment="Top"
                           Margin="20,3,0,0"
                           Text="Корпус: "/>
                <TextBox x:Name="RegistrationCorpTextBox"
                         VerticalAlignment="Top"
                         Margin="3,3,0,0"
                         Width="50"/>
                <TextBlock Foreground="{StaticResource MarkingFontColor}" 
                           VerticalAlignment="Top"
                           Margin="20,3,0,0"
                           Text="Квартира: "/>
                <TextBox x:Name="RegistrationAptTextBox"
                         VerticalAlignment="Top"
                         Margin="5,3,0,0"
                         Width="50"/>
            </WrapPanel>
			<WrapPanel Width="Auto" HorizontalAlignment="Left"
                       Margin="0,20,0,0">
                <TextBlock Foreground="{StaticResource MarkingFontColor}" 
                           VerticalAlignment="Center"
                           Text="Домашний телефон: "/>
                <TextBox Width="150"
                         x:Name="RegistrationPhoneTextBox"/>
            </WrapPanel>
					</StackPanel>
				</Border>
			</Expander>
        </StackPanel>
		</Grid>
		</ScrollViewer>
</Window>
